<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var str = 'abcamc';
    console.log(str.search('a.c'));   // 输出结果：0
    console.log(str.search(/a.c/));   // 输出结果：0
  </script>
</body>
</html>